package com.jingfu.common;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.context.request.NativeWebRequest;
import org.zalando.problem.Problem;
import org.zalando.problem.spring.web.advice.AdviceTrait;

/**
 * @author jingfuu@163.com
 * @version v1.0
 * @date 2022/1/15 下午9:26
 **/
public interface BadRequestAdviceTrait  extends AdviceTrait{

    @ExceptionHandler
    default ResponseEntity<Problem> handleBadRequestProblem(
            final BadRequestException problem,
            final NativeWebRequest request) {
        return create(problem, request);
    }


}
